package com.hzyl.famousreader.view;

import android.databinding.BindingAdapter;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;

public class DataBindingAdapter {

  @BindingAdapter({"glide"})
  public static void glideImg(View view, String src) {
    Glide.with(view).load(src).into((ImageView) view);
  }

  @BindingAdapter({"glideCircle"})
  public static void glideCircle(View view, String src) {
    Glide.with(view).load(src).apply(RequestOptions.bitmapTransform(new CircleCrop())).into((ImageView) view);
  }
}
